//
//  constraintHelper.m
//  FunPosthouse
//
//  Created by 王尧 on 2016/12/15.
//  Copyright © 2016年 wangyao. All rights reserved.
//

#import "constraintHelper.h"

#define SCALE_6p 1.104
#define SCALE_5s 0.85333
@implementation constraintHelper

+ (UIFont *)ultimateEditionBySize:(float)size isBlod:(BOOL)isBlod {
    UIFont *font;
    if (kScreenWidth == 414) {
        if (isBlod) {
            font = [UIFont boldSystemFontOfSize:ceil(size *SCALE_6p)];
        }
        else {
            font = [UIFont systemFontOfSize:ceil(size *SCALE_6p)];
        }
    }
    else if (kScreenWidth == 375) {
        if (isBlod) {
            font = [UIFont boldSystemFontOfSize:size];
        }
        else {
            font = [UIFont systemFontOfSize:size];
        }
    }
    else if (kScreenWidth == 320) {
        if (isBlod) {
            font = [UIFont boldSystemFontOfSize:ceil(size * SCALE_5s)];
        }
        else {
            font = [UIFont systemFontOfSize:ceil(size * SCALE_5s)];
        }
    }
    else {
        if (isBlod) {
            font = [UIFont boldSystemFontOfSize:size];
        }
        else {
            font = [UIFont systemFontOfSize:size];
        }
    }
    return font;
}

+ (CGFloat)autoHeight:(float)height {
    if (kScreenWidth == 414) {
        return ceil(height *SCALE_6p);
    }
    if (kScreenWidth == 375) {
        return height;
    }
    if (kScreenWidth == 320){
        return floor(height * SCALE_5s);
    }
    return ceil(height);
}

@end
